package com.hxl.demo.service.Impl;

import com.hxl.demo.entity.User;
import com.hxl.demo.mapper.UserMapper;
import com.hxl.demo.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    public List<User> getUserByNameAndPassword(String name, String password){
        return userMapper.getUserByNameAndPassword(name,password);
    }

    public Integer userAddByNameAndPassword(User user){
        user.setInsertTime(new Date());
        return  userMapper.userAddByNameAndPassword(user);
    }
}

